<template>
  <div class="payZone">
    <section class="header">
      <i class="iconfont iconfanhui1" @click="goBack()"></i>
      <span @click="goBack()">编辑缴纳区域</span>
    </section>
    <div class="main-content clearfix" v-show="!noData">
      <div class="input-box">
        <section>
          <span class="title">缴纳城市</span>
          <span class="value">
            <el-select v-model="payTheCity" filterable clearable placeholder="请选择">
              <el-option
                v-for="item in addressOptions"
                :key="item.areaCode"
                :label="item.areaName"
                :value="item.areaCode"
              >
              </el-option>
            </el-select>
          </span>
        </section>
      </div>
      <div class="clearfix"></div>
      <!-- <div class="input-box">
        <section>
          <span class="title">特殊区域</span>
          <span class="value">
            <el-select v-model="areaData.isSpecialArea" disabled placeholder="请选择">
              <el-option
                v-for="item in typeOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </span>
        </section>
      </div>-->
      <div class="input-box">
        <section>
          <span class="title">户籍类型</span>
          <span class="value">
            <el-select
              v-model="areaData.censusRegisterType"
              placeholder="请选择"
            >
              <el-option
                v-for="item in censusOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保截止日</span>
          <span class="value">
            <el-input
              placeholder="请填写日"
              v-model.number="areaData.sbEndDate"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保可补月数</span>
          <span class="value">
            <el-input
              placeholder="请填写数量"
              v-model.number="areaData.sbPayBackNum"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.sbBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.sbBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.sbBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保可跨年补缴</span>
          <span class="value">
            <el-select v-model="areaData.sbIsSpanYear" placeholder="请选择">
              <el-option
                v-for="item in yearParameter"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.sbCompanyProportion"
              @input="percentageFilter"
              maxlength="5"
              suffix-icon="iconfont iconbaifenbi"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">社保个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
              v-model.trim="areaData.sbPersonalProportion"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">养老默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.pensionBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">养老基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.pensionBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.pensionBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">养老保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.pensionCompanyProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">养老保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              suffix-icon="iconfont iconbaifenbi"
              v-model.trim="areaData.pensionPersonalProportion"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">医疗默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.medicalBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">医疗基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.medicalBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.medicalBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">医疗保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.medicalCompanyProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">医疗保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.medicalPersonalProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">失业默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.unemploymentBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">失业基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.unemploymentBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.unemploymentBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">失业保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.unemploymentCompanyProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">失业保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.unemploymentPersonalProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工伤默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.workInjuryBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工伤基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.workInjuryBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.workInjuryBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工伤保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.workInjuryCompanyProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工伤保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.workInjuryPersonalProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">生育默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.birthBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">生育基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.birthBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.birthBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">生育保险公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.birthCompanyProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">生育保险个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.birthPersonalProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">残障金默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.czjBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">残障金基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.czjBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.czjBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">残障金公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.czjCompanyProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">残障金个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.czjPersonalProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工会费默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.ghfBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工会费基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.ghfBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.ghfBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工会费公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.ghfCompanyProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">工会费个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.ghfPersonalProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">大病医疗默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.dbBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">大病医疗基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.dbBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.dbBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">大病医疗公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.dbCompanyProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">大病医疗个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.dbPersonalProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金截止日</span>
          <span class="value">
            <el-input
              placeholder="请填写日"
              v-model.number="areaData.gjjEndDate"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金可补月数</span>
          <span class="value">
            <el-input
              placeholder="请填写数量"
              v-model.number="areaData.gjjPayBackNum"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金默认基数</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.gjjBaseValue"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金基数</span>
          <span class="value">
            <el-input
              class="base"
              placeholder="起始基数"
              v-model.trim="areaData.gjjBaseStart"
              clearable
            ></el-input>
            <span>-</span>
            <el-input
              class="base"
              placeholder="终止基数"
              v-model.trim="areaData.gjjBaseEnd"
              clearable
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金可跨年补缴</span>
          <span class="value">
            <el-select v-model="areaData.gjjIsSpanYear" placeholder="请选择">
              <el-option
                v-for="item in yearParameter"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金公司比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.gjjCompanyProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
      <div class="input-box">
        <section>
          <span class="title">公积金个人比例</span>
          <span class="value">
            <el-input
              placeholder="请填写"
              v-model.trim="areaData.gjjPersonalProportion"
              suffix-icon="iconfont iconbaifenbi"
              @input="percentageFilter"
              maxlength="5"
            ></el-input>
          </span>
        </section>
      </div>
    </div>
    <div class="main-content" v-show="noData">
      <div class="nodata">暂无数据</div>
    </div>
    <div class="button-box clearfix">
      <div class="comfirm" v-show="!noData" @click="sum()">保存</div>
      <div class="goback" @click="goBack()">返回</div>
      <div
        class="comfirm"
        v-show="!noData"
        @click="upData()"
        title="用于更新人员账单"
      >
        生成账单
      </div>
    </div>
  </div>
</template>

<script>
import base from "@/assets/js/base";
import commonData from "@/assets/js/commonData";
import { requestApiPost } from "../api/api";
import { reqRep } from "../report/reqReport";
import { resRep } from "../report/resReport";
export default {
  name: "payZone",
  data() {
    return {
      addressOptions: [], //缴纳城市
      payTheCity: "", //选择城市
      noData: true,
      cityCode: "",
      areaData: {},
      censusOptions: [],
      typeOptions: [
        {
          value: 1,
          label: "正常",
        },
        {
          value: 2,
          label: "特殊",
        },
      ],
      yearParameter: [
        {
          value: 0,
          label: "否",
        },
        {
          value: 1,
          label: "是",
        },
      ],
    };
  },
  methods: {
    isClick(num) {
      this.isNumber = num;
    },
    switchFun(i) {
      this.switchIndex = i;
    },
    //比例
    percentageFilter(e) {
      if (e < 0 || e > 100) {
        this.$message({
          message: "请填写正确比例",
          type: "warning",
          duration: 1500,
        });
      }
    },
    searchAddress(e) {
      this.cityCode = e.city.code;
    },
    search() {
      base
        .getAjax("/businessManger/sbGjjRuleInfo", {
          cityCode: JSON.parse(sessionStorage.getItem("payZoneObj")).areaCode,
          companyId: sessionStorage.getItem("areaCompanyId"),
        })
        .then((res) => {
          if (res.data.code == 1) {
            if (res.data.data) {
              this.noData = false;
              this.areaData = res.data.data;
              this.payTheCity = res.data.data.cityCode;
            } else {
              this.noData = true;
            }
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
              duration: 1500,
            });
          }
        })
        .catch((err) => {
          this.$message({
            message: err.data.message,
            type: "error",
            duration: 1500,
          });
        });
    },
    goBack() {
      sessionStorage.removeItem("payZoneObj");
      this.$router.go(-1);
    },
    //更新数据
    upData() {
      base
        .getAjax("/businessManger/payRuleSaveUpdate", {
          id: this.areaData.id,
        })
        .then((res) => {
          if (res.data.code == 1) {
            this.$message({
              message: res.data.message,
              type: "success",
              duration: 1500,
            });
          } else {
            this.$message({
              message: res.data.message,
              type: "error",
              duration: 1500,
            });
          }
        })
        .catch((err) => {
          this.$message.error(err.data.message);
        });
    },

    sum() {
      if (!this.payTheCity) {
        this.$message({
          message: "请选择缴纳城市",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.areaData.censusRegisterType) {
        this.$message({
          message: "请选择户籍类型",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.areaData.sbEndDate) {
        this.$message({
          message: "请选择社保截止日",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.areaData.sbPayBackNum) {
        this.$message({
          message: "请填写社保可补月数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseInt(this.areaData.sbPayBackNum) > 10 ||
        parseInt(this.areaData.sbPayBackNum) < 1 ||
        !base.isInteger(this.areaData.sbPayBackNum)
      ) {
        this.$message({
          message: "社保可补月数必须在1到10之间",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.areaData.sbBaseValue) {
        this.$message({
          message: "请填写社保默认基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.areaData.sbBaseStart || !this.areaData.sbBaseEnd) {
        this.$message({
          message: "请填写社保基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.areaData.gjjEndDate) {
        this.$message({
          message: "请填写公积金截止日",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.areaData.gjjPayBackNum) {
        this.$message({
          message: "请填写公积金可补月数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseInt(this.areaData.gjjPayBackNum) > 10 ||
        parseInt(this.areaData.gjjPayBackNum) < 1 ||
        !base.isInteger(this.areaData.gjjPayBackNum)
      ) {
        this.$message({
          message: "公积金可补月数必须在1到10之间",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.areaData.gjjBaseValue) {
        this.$message({
          message: "请填写公积金默认基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (!this.areaData.gjjBaseStart || !this.areaData.gjjBaseEnd) {
        this.$message({
          message: "请填写公积金基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseFloat(this.areaData.sbBaseStart) >
        parseFloat(this.areaData.sbBaseEnd)
      ) {
        this.$message({
          message: "社保起始基数必须小于终止基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseFloat(this.areaData.sbBaseValue) <
          parseFloat(this.areaData.sbBaseStart) ||
        parseFloat(this.areaData.sbBaseValue) >
          parseFloat(this.areaData.sbBaseEnd)
      ) {
        this.$message({
          message: "社保默认基数必须介于社保基数之间",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseFloat(this.areaData.gjjBaseStart) >
        parseFloat(this.areaData.gjjBaseEnd)
      ) {
        this.$message({
          message: "公积金起始基数必须小于终止基数",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      if (
        parseFloat(this.areaData.gjjBaseValue) <
          parseFloat(this.areaData.gjjBaseStart) ||
        parseFloat(this.areaData.gjjBaseValue) >
          parseFloat(this.areaData.gjjBaseEnd)
      ) {
        this.$message({
          message: "公积金默认基数必须介于社保基数之间",
          type: "warning",
          duration: 1500,
        });
        return;
      }
      base
        .postAjax("/businessManger/payRuleSave", {
          companyId: sessionStorage.getItem("areaCompanyId"),
          province: this.areaData.province,
          city: this.areaData.city,
          cityCode: this.payTheCity,
          censusRegisterType: this.areaData.censusRegisterType,
          sbPayBackNum: this.areaData.sbPayBackNum,
          gjjPayBackNum: this.areaData.gjjPayBackNum,
          sbEndDate: this.areaData.sbEndDate,
          gjjEndDate: this.areaData.gjjEndDate,
          sbBaseStart: this.areaData.sbBaseStart,
          sbBaseEnd: this.areaData.sbBaseEnd,
          gjjBaseStart: this.areaData.gjjBaseStart,
          gjjBaseEnd: this.areaData.gjjBaseEnd,
          sbBaseValue: this.areaData.sbBaseValue,
          gjjBaseValue: this.areaData.gjjBaseValue,
          sbIsSpanYear: this.areaData.sbIsSpanYear,
          gjjIsSpanYear: this.areaData.gjjIsSpanYear,
          gjjCompanyProportion: this.areaData.gjjCompanyProportion,
          gjjPersonalProportion: this.areaData.gjjPersonalProportion,
          isSpecialArea: this.areaData.isSpecialArea,

          sbCompanyProportion: this.areaData.sbCompanyProportion,
          sbPersonalProportion: this.areaData.sbPersonalProportion,
          pensionBaseValue: this.areaData.pensionBaseValue,
          pensionBaseStart: this.areaData.pensionBaseStart,
          pensionBaseEnd: this.areaData.pensionBaseEnd,
          pensionCompanyProportion: this.areaData.pensionCompanyProportion,
          pensionPersonalProportion: this.areaData.pensionPersonalProportion,
          medicalBaseValue: this.areaData.medicalBaseValue,
          medicalBaseEnd: this.areaData.medicalBaseEnd,
          medicalBaseStart: this.areaData.medicalBaseStart,
          medicalCompanyProportion: this.areaData.medicalCompanyProportion,
          medicalPersonalProportion: this.areaData.medicalPersonalProportion,
          unemploymentBaseValue: this.areaData.unemploymentBaseValue,
          unemploymentBaseStart: this.areaData.unemploymentBaseStart,
          unemploymentBaseEnd: this.areaData.unemploymentBaseEnd,
          unemploymentCompanyProportion:
            this.areaData.unemploymentCompanyProportion,
          unemploymentPersonalProportion:
            this.areaData.unemploymentPersonalProportion,
          workInjuryBaseValue: this.areaData.workInjuryBaseValue,
          workInjuryBaseStart: this.areaData.workInjuryBaseStart,
          workInjuryBaseEnd: this.areaData.workInjuryBaseEnd,
          workInjuryCompanyProportion:
            this.areaData.workInjuryCompanyProportion,
          workInjuryPersonalProportion:
            this.areaData.workInjuryPersonalProportion,
          birthBaseValue: this.areaData.birthBaseValue,
          birthBaseEnd: this.areaData.birthBaseEnd,
          birthBaseStart: this.areaData.birthBaseStart,
          birthCompanyProportion: this.areaData.birthCompanyProportion,
          birthPersonalProportion: this.areaData.birthPersonalProportion,
          czjBaseValue: this.areaData.czjBaseValue,
          czjBaseStart: this.areaData.czjBaseStart,
          czjBaseEnd: this.areaData.czjBaseEnd,
          czjCompanyProportion: this.areaData.czjCompanyProportion,
          czjPersonalProportion: this.areaData.czjPersonalProportion,
          ghfBaseValue: this.areaData.ghfBaseValue,
          ghfBaseStart: this.areaData.ghfBaseStart,
          ghfBaseEnd: this.areaData.ghfBaseEnd,
          ghfCompanyProportion: this.areaData.ghfCompanyProportion,
          ghfPersonalProportion: this.areaData.ghfPersonalProportion,
          dbBaseValue: this.areaData.dbBaseValue,
          dbBaseStart: this.areaData.dbBaseStart,
          dbBaseEnd: this.areaData.dbBaseEnd,
          dbCompanyProportion: this.areaData.dbCompanyProportion,
          dbPersonalProportion: this.areaData.dbPersonalProportion,
        })
        .then((res) => {
          if (res.data.code == 1) {
            this.$message({
              message: res.data.message,
              type: "success",
              duration: 1500,
            });
          }
        })
        .catch((err) => {
          this.$message.error(err.data.message);
        });
    },
  },
  created() {
    this.censusOptions=commonData.censusOptions;
    
    this.addressOptions = base.getAddress();
    this.search();
  },
};
</script>
<style scoped>
.header {
  padding: 15px;
  height: 50px;
  box-sizing: border-box;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}
.header i {
  margin-right: 5px;
  cursor: pointer;
}
.header span {
  cursor: pointer;
}
.main-content {
  padding: 30px;
}
h2 {
  display: block;
  color: #333;
  font-size: 16px;
  margin: 30px 0;
  clear: both;
}
.input-box {
  float: left;
  /* width: 400px; */
  margin-right: 40px;
  margin-bottom: 20px;
}
.search-box .input-box {
  margin: 0;
  height: auto;
}
.nbsp {
  float: none;
  display: block;
}
.input-box .title {
  display: inline-block;
  margin-right: 7px;
  width: 100px;
  color: #666;
}
.input-box .value {
  display: inline-block;
}
.input-box .value input {
  width: 228px;
}
.input-box .value .base {
  width: 106px;
}
.error {
  text-align: center;
}

.button-box {
  clear: both;
  border-top: 1px solid #eee;
  padding: 30px;
  margin: 0 auto;
}
.button-box div {
  display: inline-block;
  width: 80px;
  padding: 8px 10px;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  color: #fff;
  margin-right: 30px;
}
.comfirm {
  background-color: #13cb6e;
}
.goback {
  background-color: #999;
}
.create-order {
}
.add {
  color: #fff;
  background-color: deepskyblue;
}
.tip {
  color: #f56c6c;
  font-size: 12px;
}
.sm-f {
  padding: 30px;
}
.sm-f > ul {
  display: inline-block;
  margin-right: 15px;
  color: #666;
}
.sm-f .value {
  color: #666;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 5px;
}
.sm-f .no {
  opacity: 0;
}
.sm-f .button {
  float: right;
  width: 140px;
  text-align: center;
  height: 50px;
  font-size: 20px;
  line-height: 50px;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  background-color: #13cb6e;
}
.footer {
  padding: 10px 30px 30px;
  color: #999;
}
.footer span {
  margin-right: 50px;
}
.hint {
  padding: 0 30px 10px;
  color: #999;
}
.el-input,
.el-select {
  width: 228px;
}
.nodata {
  color: #999;
  font-size: 14px;
}
</style>